<template>
  <!-- <yd-infinitescroll :callback="loadList" ref="infiniteScrollHotspot"> -->
    <div class="m-hotspot-list">
      <w-empty v-if="!hotspotList.length"></w-empty>
      <ListItem v-for="(hotspot, index) in hotspotList" :key="index" :hotspot="hotspot" />
    </div>
    <!-- 数据全部加载完毕显示 -->
    <!-- <span slot="doneTip">啦啦啦，啦啦啦，没有数据啦~~</span> -->
    <!-- 加载中提示，不指定，将显示默认加载中图标 -->
    <!-- <p slot="loadingTip">加载中...</p> -->
  <!-- </yd-infinitescroll> -->
</template>

<script>
  import { apiHotspot } from 'js/api'
  import ListItem from './listItem.vue'
  
  export default {
    props: {
      id: [String, Number]
    },
    data() {
      return {
        hotspotList: []
      }
    },
    created() {
      apiHotspot(this.$store.getters.token, this.id).then(data => {
        this.hotspotList = data.hotspotInfoLists || []
      })
    },
    methods: {
      // loadList() {
        // this.$http.jsonp('http://list.ydui.org/getdata.php?type=backposition', {
        //   params: {
        //     page: this.page,
        //     pagesize: this.pageSize
        //   }
        // }).then(function (response) {
        //   const _list = response.body
        //   this.list = [...this.list, ..._list]
        //   if (_list.length < this.pageSize || this.page == 3) {
        //     /* 所有数据加载完毕 */
        //     this.$refs.infiniteScrollHotspot.$emit('ydui.infinitescroll.loadedDone');
        //     return
        //   }
        //   /* 单次请求数据完毕 */
        //   this.$refs.infiniteScrollHotspot.$emit('ydui.infinitescroll.finishLoad');
        //   this.page++
        // })
      // }
    },
    components: {
      ListItem
    }
  }
</script>

<style lang="scss">

</style>